package com.ydgk.service.impl;

import com.ydgk.bean.*;
import com.ydgk.dao.*;
import com.ydgk.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class GoodsServiceImpl implements GoodsService {
    @Autowired
    private FurnitureMapper furnitureMapper;

    @Autowired
    private FurnitureKindsMapper furnitureKindsMapper;

    @Autowired
    private KindsMapper kindsMapper;

    @Autowired
    private KindsTypeMapper kindsTypeMapper;

    @Autowired
    private ViewMapper viewMapper;

    @Autowired
    private DetailMapper detailMapper;

    public List<Furniture> findAllFurniture(Map<String, Object> factorMap) {
        return furnitureMapper.findAll(factorMap);
    }

    public List<Kinds> findAllKinds() {
        return kindsMapper.findAll();
    }

    public List<KindsType> findAllKindsTypeByKid(int kid) {
        return kindsTypeMapper.findAllByKid(kid);
    }

    public KindsType findKindsTypeByKtname(String newsName) {
        return kindsTypeMapper.findByKtname(newsName);
    }

    public Furniture findFurnitureById(int fid) {
        return furnitureMapper.findById(fid);
    }

    public List<View> findViewByFid(int fid) {
        return viewMapper.findByFid(fid);
    }

    public List<Detail> findDetailByFid(int fid) {
        return detailMapper.findByFid(fid);
    }

    public List<FurnitureKinds> findFurnitureKindsByFid(int fid) {
        return furnitureKindsMapper.findByFid(fid);
    }

    public int findAllFurnitureCount(Map<String, Object> factorMap) {
        return furnitureMapper.findAllCount(factorMap);
    }

}
